package mobi.yuanshen.oss;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Slf4j
@Configuration
@EnableConfigurationProperties(FileParamsUtils.class) // 将FileParamsUtils配置类导入ioc容器
public class YuanShenOSSAutoConfiguration {

    @Bean
    // Spring会自动从IOC容器中获取与形参类型相同的Bean注入到形参中。
    public FileTransforServer fileTransforServer (FileParamsUtils fileParamsUtils) {
        FileTransforServer fileTransforServer = new FileTransforServer();
        fileTransforServer.setParamsUtils(fileParamsUtils);
        log.info("yuanshen-oss已经被成功加载");
        return fileTransforServer;
    }

}
